<%--
  Created by IntelliJ IDEA.
  User: 花生
  Date: 2020/5/14
  Time: 0:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<script>
    function tijiao() {
        //js对象
        var data={logo:$("#logo").val(),
            phone:$("#phone").val(),
            ad:$("#ad").val(),
            html:$("#html").val(),
            email:$("#email").val(),
            linePhone:$("#linePhone").val(),
            edition:$("#edition").val()
        };
        $.ajax({
            url:'/CompanyAdd',//访问后台的地址
            type:'post',//访问后台的类型
            //封装传递给后台的数据
            data:data,
            datatype:'text',
            success:function (data) {
                if(data == 1){
                    $('#homeRight').load('/back/CompanySelect.jsp')
                }else {
                    alert("很遗憾，操作失败")
                }
            }
        })

    }
</script>
<body>
<a href="javaScript:$('#homeRight').load('/back/CompanySelect.jsp')">查询</a>
<%--一般情况查询用get，  新增修改删除数据的时候用post --%>
<Form>
    <div>
        logo<input type="text" name="content" id="content">
    </div>
    <div>
        电话<input type="text" name="phone" id="phone">
    </div>
    <div>
       广告<input type="text" name="ad" id="ad">
    </div>
    <div>
        网址<input type="text" name="html" id="html">
    </div>
    <div>
        邮箱<input type="text" name="email" id="email">
    </div>
    <div>
        座机<input type="text" name="linePhone" id="linePhone">
    </div>
    <div>
        版本<input type="text" name="edition" id="edition">
    </div>
    <div>
        <input type="button" value="提交" onclick="tijiao()">
    </div>
</Form>

</body>
</html>
